package demo1;

import java.util.LinkedList;

public class Main {
    public static void main(String[] args) {
        //LinkedList 可以实现队列结构和栈结构
        LinkedList<String> stack = new LinkedList<>();
        stack.addFirst("第一枪");
        stack.addFirst("第二枪");
        stack.addFirst("第三枪");
        stack.addFirst("第四枪");
        System.out.println(stack);

        System.out.println(stack.getFirst());
        stack.pop();

        System.out.println(stack);
    }
}
